<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="/WEB-INF/jsp/includeTop.jsp" %>

<table width="100%" border="0" cellpadding="0" cellspacing="5">
  <tr>
    <td valign="top">
      <table class="dbborder" width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td valign="bottom" class="blueTableBg">&nbsp;配置管理&nbsp;-&nbsp;步骤维护</td>
        </tr>
        <tr>
          <td>
            <table width="100%" border="0" cellpadding="0" cellspacing="5">
              <tr>
                <td>
                  <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td class="dashTopLeft"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                      <td class="dashTop" width=100%><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                      <td class="dashTopRight"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                    </tr>

                    <tr>
                      <td class="dashLeft"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                      <td align="center">
                        <table width="100%" border="0" cellpadding="0" cellspacing="0">

						  <tr>
						     <td>
						       <table class="dbborder" width="100%" border="0" cellpadding="0" cellspacing="1">
						         <tr class="rowHead">
                                   <td height="20" nowrap align="center" class="globalTextBold">数据类型</td>
						           <td height="20" nowrap align="center" class="globalTextBold">步骤名称</td>
                                   <td height="20" nowrap align="center" class="globalTextBold">更新时间</td>
						           <td height="20" nowrap align="center" class="globalTextBold">操作</td>
						         </tr>


                                 <c:set var="actionType" value="-1"/>
                                 <c:set var="groupClass" value="group1"/>
						         <c:forEach var="task" items="${taskList}" varStatus="status">
                                     <c:if test="${task.actionId != actionType}">
                                         <c:set var="actionType" value="${task.actionId}"/>
                                         <c:choose>
                                             <c:when test="${groupClass == 'group1'}">
                                                 <c:set var="groupClass" value="group0"/>
                                             </c:when>
                                             <c:otherwise>
                                                 <c:set var="groupClass" value="group1"/>
                                             </c:otherwise>
                                         </c:choose>
                                     </c:if>
						         	<tr class="rowClass <c:out value="${groupClass}"/>">
                                        <td height="20" class="globalText">${task.actionName}</td>
							            <td height="20" class="globalText leftAlign">${task.dataTypeName}</td>
                                        <td height="20" class="globalText"><fmt:formatDate value="${task.updatedAt}" pattern="yyyy-MM-dd HH:mm"/></td>
							            <td height="20" class="globalText">
							            	<c:if test="${task.action.id==6 || task.action.id==4}">
							            		<input type="button" class="btnStyle" value="查看子项" onclick="javascript:window.location='stepDetail.html?id=${task.id}'">
							           		</c:if>
                                            <input type="button" class="btnStyle" value="删除" onclick="javascript:removeStep(${task.id})">
										</td>
							          </tr>
						         </c:forEach>




						       </table>
						     </td>
						   </tr>

                        </table><p/>
                      </td>
                      <td class="dashRight"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                    </tr>
                    <tr>
                      <td class="dashBottomLeft"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                      <td class="dashBottom" width=100%><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                      <td class="dashBottomRight"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<form target="tempFrame" method="post" id="removeStep" action="<c:url value='/admin/removeStep.html' />">
    <input type="hidden" id="stepId" name="taskId"/>
</form>
<script type="text/javascript">
    function removeStep(id) {
        if (confirm('删除［步骤项］并不修改使用该步骤项的［任务］\n删除后如果需要恢复，请联系系统管理员\n\n请确认是否删除步骤项？')) {
            $('#stepId').val(id);
            $('#removeStep').submit();
        }
    }

    function submitCallbackSuccess(obj){
        window.location="<c:url value='/admin/stepList.html' />";
    }
</script>
